import Vue from 'vue'
import './cube-ui'
import App from './App.vue'
import { post, upload, get } from './util/url'
import 'amfe-flexible'
import 'animate.css'
import router from './router'
import VueLazyload from 'vue-lazyload'
import '@/assets/fonts/iconfont.css'
import '@/assets/fonts/iconfont.js'
import store from './store'

// 设置微信操作对象
if(process.env.NODE_ENV === 'production'){
  Vue.prototype.$wx = window.wx
  // 隐藏非必要按钮
  window.wx.hideAllNonBaseMenuItem()
  window.wx.showMenuItems({
    menuList: ["menuItem:share:appMessage","menuItem:share:timeline","menuItem:favorite"]
  })
}

Vue.config.productionTip = false
Vue.config.ignoredElements = ['wx-open-subscribe']

Vue.prototype.$post = post
Vue.prototype.$get = get
Vue.prototype.$upload = upload

// 图片懒加载
Vue.use(VueLazyload)

// 设置入口红包id
if(window.louie.enter_red) store.commit('enter_red',window.louie.enter_red)

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
